<template>
    <div id='' class='i_helpDown'>
        <div class="title">
            <img :src="file" alt="" srcset="">
            <span>帮助文档</span>
        </div>
        <div class="content">
            <Tab :module="'帮助文档'" :list="tab" @onClick="changeTab" @addMore="addMore" />
            <div class="list">
                <div v-for="(item,index) in list" :key="index" class="item" @click="downLoad(item)">
                    <div class="headline"><img :src="pdf" alt="" srcset="" style="margin-right:10px;">
                        <!-- <Ellipsis :text="item.wdName" :lines="1" tooltip /> -->
                        <p class="headline-content" :title='item.wdName'>{{item.wdName}}</p>
                    </div>
                    <!-- <div class="tail">
                        <div class="title">{{item.wdRemarks}}</div>
                        <div class="line">|</div>
                        <div class="time">{{item.createDate}}</div>
                    </div> -->
                </div>
            </div>
            <!-- <div style="font-size: 14px; font-family: PingFang SC-Regular, PingFang SC; font-weight: 400; color: #515A6E;">...</div> -->
        </div>

    </div>
</template>
<script>
import Tab from './tab.vue'
import pdf from '@/assets/svg/fontApp/pdf_icon.svg'
import file from '@/assets/svg/fontApp/why_icon.svg'
import { UpLoad } from '@/mixins/uploadMixins.js'
export default {
    name: '',
    props: [''],
    data() {
        return {
            file: file,
            pdf: pdf,
            list: [],
            tab: [
                { title: '系统介绍', default: true },
                { title: '操作手册', default: false },
            ],
            wdType: '系统介绍',
        };
    },
    components: { Tab },
    computed: {},
    beforeMount() { },
    mixins: [UpLoad],
    mounted() {
        this['$api'] = this.$Api.get(['systemSetup:systemManger']);
        this.getList();
    },
    methods: {
        getList() {
            this.$api.DocumentPage({ "limit": 4, "page": 1, wdType: this.wdType }, res => {
                if (res.code == 200) {
                    this.list = res.data.records ? res.data.records : [];
                }
            })
        },
        changeTab(data) {
            this.wdType = data.title;
            this.getList();
        },
        addMore(event) {
            this.$router.push({
                path: `/detailView/index/${event.title}`
            })
        },
        cancel() {
            this.modalShow = false
        },

        downLoad(data) {
            let file = data.doc;
            if (file) {
                this.downloadUrl(file.minioPath, file);
            } else {
                this.$Message.warning('暂无附件')
            }
        },
        print() {

        },
    },
    watch: {}
}
</script>
<style lang='less' scoped>
.i_helpDown {
    width: 50%;
    padding: 20px 20px 20px 10px;
    // background: red;
    .title {
        display: flex;
        align-items: center;
        span {
            margin-left: 10px;
            font-size: 18px;
            font-family: PingFang SC-Bold, PingFang SC;
            font-weight: bold;
            color: #17233d;
        }
        img {
            width: 32px;
            height: 32px;
        }
    }
    .content {
        width: 100%;
        height: 240px;
        margin-top: 15px;
        border-radius: 8px;
        background: #f8f8f9;
        padding: 20px 20px;
        .item {
            // height: 20px;
            display: flex;
            justify-content: space-between;
            height: 35px;
            align-items: center;
            cursor: pointer;
            .headline {
                width: 100%;
                font-size: 16px;
                font-family: PingFang SC-Regular, PingFang SC;
                color: #515a6e;
                display: flex;
                justify-content: flex-start;
                .headline-content {
                    word-break: break-all;
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                    -o-text-overflow: ellipsis;
                }
            }
            .headline:hover {
                color: #2d8cf0;
                transition: all 0.2s ease-in-out;
            }
            .tail {
                font-size: 16px;
                font-family: PingFang SC-Regular, PingFang SC;
                font-weight: 400;
                color: #808695;
                position: relative;
                width: 32%;
                display: flex;
                justify-content: space-between;
                align-items: center;
                .line {
                    position: absolute;
                    left: 103px;
                    margin-bottom: 1px;
                    color: #dcdee2;
                }
            }
        }
        .item:first-child {
            margin-top: 10px;
        }
    }
}
</style>